<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table,th,td{
            border: 2px solid #000;
            text-align: center;
            height: 20px;
            margin: 0 auto;
        }
        caption{
            font-weight: 700;
        }
        th,td{
            padding: 10px;
        }
    </style>
</head>
<body>
    <script>
        let zbalance= +prompt('请输入余额:')
        let water= +prompt('请输入水费:')
        let electricty= +prompt('请输入电费:')
        let internet= +prompt('请输入网费:')
        let balance=zbalance-water-electricty-internet
        document.write(`
        <table cellspacing="0.1">
        <caption>2020年12月消费支出</caption>
        <tr>
            <th>总余额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>剩余的余额</th>
        </tr>
        <tr>
            <td>${zbalance}</td>
            <td>${water}</td>
            <td>${electricty}</td>
            <td>${internet}</td>
            <td>${balance}</td>
        </tr>
    </table>
        `)    
    </script>
</body>
</html>